/*    */ package com.zimbra.cs.mailbox;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.mailbox.calendar.Invite;
/*    */ import com.zimbra.cs.redolog.op.CreateCalendarItemPlayer;
/*    */ import com.zimbra.cs.redolog.op.CreateCalendarItemRecorder;
/*    */ import javax.mail.internet.MimeMessage;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class Task
/*    */   extends CalendarItem
/*    */ {
/*    */   public Task(Mailbox mbox, MailItem.UnderlyingData data)
/*    */     throws ServiceException
/*    */   {
/* 30 */     this(mbox, data, false);
/*    */   }
/*    */   
/*    */   public Task(Mailbox mbox, MailItem.UnderlyingData data, boolean skipCache) throws ServiceException {
/* 34 */     super(mbox, data, skipCache);
/* 35 */     if (this.mData.type != MailItem.Type.TASK.toByte()) {
/* 36 */       throw new IllegalArgumentException();
/*    */     }
/*    */   }
/*    */   
/*    */   protected String processPartStat(Invite invite, MimeMessage mmInv, boolean forCreate, String defaultPartStat)
/*    */     throws ServiceException
/*    */   {
/* 43 */     Mailbox mbox = getMailbox();
/* 44 */     OperationContext octxt = mbox.getOperationContext();
/* 45 */     CreateCalendarItemPlayer player = octxt != null ? (CreateCalendarItemPlayer)octxt.getPlayer() : null;
/*    */     
/*    */ 
/* 48 */     String partStat = defaultPartStat;
/* 49 */     if (player != null) {
/* 50 */       String p = player.getCalendarItemPartStat();
/* 51 */       if (p != null) { partStat = p;
/*    */       }
/*    */     }
/* 54 */     CreateCalendarItemRecorder recorder = (CreateCalendarItemRecorder)mbox.getRedoRecorder();
/*    */     
/* 56 */     recorder.setCalendarItemPartStat(partStat);
/*    */     
/* 58 */     Account account = getMailbox().getAccount();
/* 59 */     invite.updateMyPartStat(account, partStat);
/* 60 */     if (forCreate) {
/* 61 */       Invite defaultInvite = getDefaultInviteOrNull();
/* 62 */       if ((defaultInvite != null) && (!defaultInvite.equals(invite)) && (!partStat.equals(defaultInvite.getPartStat())))
/*    */       {
/* 64 */         defaultInvite.updateMyPartStat(account, partStat);
/* 65 */         saveMetadata();
/*    */       }
/*    */     }
/* 68 */     return partStat;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailbox/Task.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */